
import Vue from 'vue'
import App from '@/App'
import router from './router/index'

Vue.use(router);
console.log("你妹啊----user")

Vue.config.productionTip = false;
Vue.user = {};

router.beforeEach((to, from, next) => {

  if (!Vue.user.role && !to.matched.some(record => record.meta.noAuth)) {
    next({
      name: '加载页面'
    });
  } else {
    next();
  }
  
})

const myApp = new Vue({
  el: '#app',
  router,
  template: '<App/>',
  components: {
    App
  }
});